package com.du.design.listener.human;

import com.du.design.listener.ListenEvent;
import com.du.design.listener.equipment.Equip;
import com.du.design.listener.equipment.EquipInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @desc: 英雄
 * @author: shuangdu
 * @date: 2021/7/9
 * @since: 1.8
 */
public abstract class Hero {

    public HeroElem cacheInfo;

    // 装备
    public List<Equip> equipment = new ArrayList<>();
    // 技能...

    public Hero(HeroElem elem) {
        this.cacheInfo = elem;
    }

    public static final int queueCapacity = 10;
    public Object[] queue = new Object[queueCapacity];


    public void useEquip(Equip equip) {
        if (canEquip()) {
            EquipInfo info = equip.getInfo();
            changeAttribute();
        } else {
            System.out.println("装备已经满了");
        }
    }

    public synchronized void changeAttribute() {
        HeroElem cacheInfo = this.cacheInfo;


    }

    public boolean canEquip() {
        return this.equipment.size() < 2;
    }

}
